Skip to content

Conversation

keelerm84
Copy link
Member

The default retry policy has exponential backoff with jitter. This retry
strategy is reset after some maximum retry interval.

Previously, once this reset interval occurred, it would continue to
reset every future attempt, effectively disabling the exponential
backoff algorithm.

This should no longer be the case, as we now reset the baseline used for
determine when to reset the strategy each time it is replaced with the
base strategy.

The default retry policy has exponential backoff with jitter. This retry
strategy is reset after some maximum retry interval.

Previously, once this reset interval occurred, it would continue to
reset every future attempt, effectively disabling the exponential
backoff algorithm.

This should no longer be the case, as we now reset the baseline used for
determine when to reset the strategy each time it is replaced with the
base strategy.
@keelerm84 keelerm84 requested a review from a team as a code owner February 28, 2025 17:49
Copy link
Member

@kinyoklion kinyoklion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to have some unit tests.

assert client.next_retry_delay == initial_delay * 2

# Sleeping the threshold should reset the retry thresholds
sleep(retry_delay_reset_threshold)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a little scary, but I assume we don't have an ability to mock advance time.

@keelerm84 keelerm84 merged commit fd401b5 into main Feb 28, 2025
11 checks passed
@keelerm84 keelerm84 deleted the mk/sdk-1084/backoff-logic branch February 28, 2025 19:32
keelerm84 pushed a commit that referenced this pull request Feb 28, 2025
🤖 I have created a release *beep* *boop*
---


##
[1.2.2](1.2.1...1.2.2)
(2025-02-28)


### Bug Fixes

* Fix SSE delay reset handling
([#39](#39))
([fd401b5](fd401b5))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants